package com.qf.edu.data.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

@Data
@Accessors(chain = true)
@TableName("stu")
public class Student {

    @TableId(type = IdType.AUTO)
    private Integer id;
    @NotBlank(message = "姓名不能为空！")
    private String name;
    @NotNull(message = "年龄不能为空!")
    @Range(min = 18, max = 40, message = "年龄的范围必须在{min}到{max}之间！")
    private Integer age;
}
